//
//  WBHomeViewController.swift
//  sinaWebo
//
//  Created by sinaFenQi on 2017/12/6.
//  Copyright © 2017年 sinaFenQi. All rights reserved.
//

import UIKit

private let cellID = "cellID"

class WBHomeViewController: WBBaseViewController {

    private lazy var startArrList = [String]()
    
    override func viewDidLoad() {
        super.viewDidLoad()

        // Do any additional setup after loading the view.
        loadData()
    }
    
    private func loadData() {
        for i in 0..<20 {
            startArrList.insert(i.description, at: 0)
        }
    }

    override func setupUI() {
          super.setupUI()
        navigationItem.leftBarButtonItem = UIBarButtonItem(title: "好友", target: self, action: #selector(leftItemClick))
        
        tableView.register(UITableViewCell.self, forCellReuseIdentifier: cellID)
        
    }
    @objc private func leftItemClick() -> () {
        let vc = WBDomeViewController()
        navigationController?.pushViewController(vc, animated: true)
        
    }
}
extension WBHomeViewController{

    override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
        return startArrList.count
    }
    override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
        let cell = tableView.dequeueReusableCell(withIdentifier: cellID, for: indexPath)
        cell.textLabel?.text = startArrList[indexPath.row]
        return cell
    }
}

